import { createApp } from 'vue'
import './assets/css/style.css'
import './theme/theme.less'
import 'animate.css'
import App from './App.vue'
import store from './store'
import router from './router'
// import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import echarts from './assets/ts/echarts'
import globalDirectivRegist from './directive/Index'
import plugins from '@/plugins/Index'
import $bus from './utils/bus'
import registerGlobComp from '@/components/registerGlobComp'
import lang from './lang'
// -----------------注册app----------------
const app = createApp(App)

// provide
app.provide('$echarts', echarts)
app.provide('$bus', $bus)

// 注册el-icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(store)
app.use(router)
app.use(plugins)
app.use(lang)
app.use(registerGlobComp)
app.mount('#app')

// -------------------------------------------
// console.log(app.config.globalProperties);

// 注册自定义全局指令
globalDirectivRegist(app)
